﻿{% extends 'base.html' %}
{% block titel %}个人页面{% endblock %}
{% block css %}profile{% endblock %}
{% block user_url %}
    {% if current_user.is_authenticated %}
        /profile/{{current_user.id}}
    {% else %}
        /reglogin/
    {% endif %}
{% endblock %}
{% block page_main %}
<div class="page-main clearfix">
    <article>
        <header class="profile-detail clearfix">
            <div class="profile-avatar">
                <img class="_8gpiy _r43r5 _f2b2t" src="{{ user.head_url }}">
            </div>
            <div class="profile-content">
                <div class="profile-info-main" data-reactid=".0.1.0.0:0.1.0">
                    <h1 class="name" title="taylorswift">{{ user.username }}</h1>
                    <span class="verified" title="已验证">已验证</span>
                    {% if user.id == current_user.id %}
                    <span class="_jxp6f _e616g" style="display:inline-block;position:relative;">
                        <form id="form" enctype="multipart/form-data">
                            <button class="btn-success">上传图片</button>
                            <input name="file" type="file" onchange="submitImg()" style="opacity:0;position:absolute;top:0;left:0;display:block;width:100%;height:100%;">
                        </form>
                    </span>
                    <button class="more-info">选项</button>
                    {% endif %}
                </div>
                <!--
                <div class="profile-info-sub">
                    <h2>Taylor Swift</h2>
                    <span class="birth">Born in 1989.</span>
                </div>
                -->
                <ul class="status-list clearfix">
                    <li>
                        <span class="s-title">已发帖 </span>
                        <span class="s-num" id="s-num">{{ imgs }}</span>
                    </li>

                    <li>
                        <span class="s-num">{{ user.concern|length }}</span>
                        <span class="s-title">人关注 </span>
                    </li>
                    <!--
                    <li>
                        <span class="s-title">已关注 </span>
                        <span class="s-num">909万</span>
                    </li>
                    -->
                </ul>
            </div>
        </header>
        <div class="list-mod">
            <div class="list clearfix js-image-list" id="img_lists">
                {% for image in images %}
                <a class="item" href="/image/{{ image.id }}/">
                    <div class="img-box">
                        <img src="{{ image.url }}">
                    </div>
                    <!--
                    <span class="ico-video">视频</span>
                    <div class="img-mask"></div>
                    <div class="interaction-wrap">
                        <div class="interaction-item"><i class="icon-comment"></i> 23214</div>
                    </div>
                    -->
                </a>
                {% endfor %}
            </div>
            {% if has_next %}
            <!--<div class="more-content js-load-more">-->
            <div id="more" class="more-content js-load-more">
                <a class="_oidfu" href="javascript:void(0);" onclick="getMoreImg()"  display="block">更多</a>
            </div>
            {% endif %}
        </div>
    </article>
</div>
{% endblock %}

{% block js %}
<script type="text/javascript">
    window.uid = {{current_user.id}};
    //alert(window.uid);
</script>
<!--<script type="text/javascript" src="/static/js/jquery.js"></script>-->
<script type="text/javascript" src="/static/js/profile.js"></script>
{% endblock%}